import React, { Component } from 'react'
import { connect } from 'react-redux'
import { MainAction } from '@act'

class ImageItem extends Component {
  clickImageItem = () => {
    const { url, dispatch } = this.props
    dispatch(MainAction.toggleGlobalBigImage({ url }))
  }
  render() {
    const { url, color_theme } = this.props
    return (
      <div onClick={this.clickImageItem} className="qa_image" style={{ backgroundImage: 'url(' + url + ')' }}>
        <div className="triangle"></div>
      </div>
    )
  }
}

const mapStateToProps = (state) => {
  return state
}

export default connect(mapStateToProps)(ImageItem)
